home *** CD-ROM | disk | FTP | other *** search
- Path: druid.borland.com!usenet
- From: pete@borland.com (Pete Becker)
- Newsgroups: comp.lang.c++
- Subject: Re: Pure Virtual Destructor Question
- Date: 16 Feb 1996 19:22:49 GMT
- Organization: Borland International
- Distribution: world
- Message-ID: <4g2li9$f81@druid.borland.com>
- References: <4fecq0$k4e@news4.digex.net> <4fg2s5$r02@cnn.exu.ericsson.se> <4fgp0o$759@news4.digex.net> <4fha1v$89v@news4.digex.net>
- NNTP-Posting-Host: pbecker.borland.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=ISO-8859-1
- X-Newsreader: WinVN 0.99.5
-
- In article <4fha1v$89v@news4.digex.net>, ell@access1.digex.net says...
- >
- >Ell (ell@access1.digex.net) wrote:
- >: Mickey Williams 66753 (ebumow@ebu.ericsson.com) wrote:
- >: : In article k4e@news4.digex.net, ell@access4.digex.net (Ell) writes:
- >: :
- >: : >Immediately above you are logically "defining" your "pure virtual"
- >: : >destructor "inside the class where it is "declared" as a pure virtual
- >: : >function. It is _illegal_ to logically, or physically "define" a pure
- >: : >virtual function in the class it is "declared" in. A pure virtual
- should
- >: : >only be defined in classes derived from the class where the pure virtual
- >: : >is declared. Only derived classes should "do some destructor stuff".
- >:
- >: : This is not true in the case of pure virtual destructors. You must
- >: : always provide a function body for a virtual dtor, even if it
- >: : is pure.
- >:
- >: Another non-orthogonal, non-intuitive C++ ism. Oh well.
- >:
- >: Elliott
- >
- >Don't get me wrong, I like the power, oo virtuality, and flexibility of
- >the language, and this makes it beautiful for many circumstances. But
- >some things about it are non-orthogonal, and non-intuitive, though
- >probably necessary due to its C roots.
-
- In C++ any pure virtual function that will be called by other code must have a
- function body. Why is this "non-orthogonal" when applied to destructors?
- -- Pete
-
-